--[[
文件名: main.lua
描述: 流体反应堆入口
作者: 671643387@qq.com
创建日期: 2025-09-20
]]

package.path = '../?.lua;' .. package.path

local term_util = require('kernel.util.term_util')

-- 配置文件名字
local CONFIG_NAME = './fluid_reactor.dat'

-- 导入功能函数
local init_reactor = require('fluid_reactor.command.init_reactor')
local run_reactor = require('fluid_reactor.command.run_reactor')

-- 输出欢迎信息
print("Welcome to fluid-reactor management system.")

while true do
    -- 输出功能选项
    print("Please choose a option:")
    print("    1  init reactor")
    print("    2  run reactor")
    print("    3  quit")

    -- 读取输入
    local command = term_util.read_number(1, 3)

    -- 执行命令
    if command == 1 then
        init_reactor(CONFIG_NAME)
    elseif command == 2 then
        run_reactor(CONFIG_NAME)
    elseif command == 3 then
        break
    end
end
